﻿@using IdentityServer4.Extensions

@{
    string name = null;
    if (!true.Equals(ViewData["signed-out"]))
    {
        name = Context.User?.GetDisplayName();
    }
}
<div class="nav-page">
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">

        <a href="~/" class="navbar-brand">
            <img src="~/icon.png" class="icon-banner">
            IdentityServer4
        </a>


        <ul class="navbar-nav mr-auto">
            @if (!string.IsNullOrWhiteSpace(name))
            {
                <li class="nav-item dropdown">
                    <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">@name <b class="caret"></b></a>

                    <div class="dropdown-menu">
                        <a class="dropdown-item" asp-action="Logout" asp-controller="Account">Logout</a>
                    </div>
                </li>
            }

            <li class="nav-item dropdown">
                <a href="~/user" class="navbar-brand">
                    用户列表
                </a>
            </li>
        </ul>
    </nav>
</div>
